# functional version

resTable <- toDataFrame(
                        orderby(
                                groupby(
                                        join(load(g, quote(company)),
                                             as.glade(g, myData),
                                             joinCond=quote(
                                                 company.cid == cF.cid
                                                 )
                                             )
                                        groupatt = quote( company.industry,
                                            company.year), aggregate=quote(SumGLA),
                                        result=quote(ind, year, sum)
                                        )
                                order=quote( ind, year, sum ), limit=10 
                                )
                        quote( ind(numeric) = ind,
                            year(numeric) = year, total(numeric) =
                                sum)
                        );

